Repository navigation
fix(revision): reject stale synthetic-merge bases before current-base qualification - #1641
Merged
Merged
Conversation
… qualification The merge-result branch of admit_revision validated only the head-side parent against the supplied PR head and never compared the base-side parent to the resolved base_ref tip, so a lazily refreshed synthetic merge built on an older base revision was admitted as current-base. The merge result is now rejected with actionable recovery text when parents[0] differs from the resolved base tip; merges rebuilt on the current base still admit. Fixes #1569
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 26 minutes. View limit details
|
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect
#1569 (P1 evidence-identity defect under #840 / #950). In the merge-result branch of
admit_revision(src/revision_admission.rs:406-436at mainc6bc743b), admission validated only thatparents[1]equals the supplied PR head and never comparedparents[0]to the resolvedbase_reftip (src/revision_admission.rs:381). GitHub'srefs/pull/N/mergerefreshes lazily, so a synthetic merge built against a preceding base revision passed current-base qualification while diffs and proofs ran against different base content — the exact hosted subject recorded in the issue (declared base9007bdb6vs. actual merge parentd0b0f032).Fix
Before admitting a merge result with
ReviewSemantics::MergeResult, compare its base-side parent (parents[0]) to the resolvedbase_reftip and fail admission on mismatch, mirroring how the other admission negativesbail!in the same branch. The message names the resolved tip, the offending parent, the reviewed checkout, and the actionable recovery (rebuild the synthetic merge against the current base tip), satisfying the issue's criterion 2. Legitimate candidate-head and merged-on-current-base flows are unchanged; no schema, verifier, or policy surfaces are touched.Regression test
stale_merge_bases_are_rejected_but_current_merges_admit(in the module's existing git-DAG test style, satisfying issue criterion 4's disposable DAG): builds base B and head H, merges M(B,H), advances the target to B2 without rebuilding M, and asserts admission of M with base B2 fails (not the base-side parent/rebuild the synthetic merge, naming B2), then asserts a fresh M2(B2,H) admits asmerge_result. Discrimination verified: with the production check removed (test retained), the test fails with "stale-base merge must not be admitted"; with the fix restored it passes.Validation (from F:/Temp/fix-1569, CARGO_TARGET_DIR=H:/Code/Rust/ub-review/target)
cargo fmt --all --check— clean.cargo clippy --locked --workspace --all-targets— warning set byte-identical to anorigin/mainbaseline captured by stashing the diff (6 pre-existing warnings, incl. the toleratedsrc/proof/red_green.rs:385;fixture_statusdead-code in test "cli" and two in testpr_context_hydration). No new warnings.cargo test --locked --bin ub-review revision_admission— 18 passed, 0 failed.Known gaps
symlink_target_is_part_of_the_admitted_tree_and_repeats_stably) were skipped locally; the Linux gate covers them.Fixes #1569